% Chakram is a subproject of Hexena - Haskell Executable Analyser
% License:			GPL-3
% Maintainer:		Montez Fitzpatrick
% Stability:		Experimental
% Portability:		GHC
% Module:			Hexena.Codec.Parser.FileHeader

IMAGE_FILE_HEADER

File Header format can be found in WinNT.h lines (10906-10920)
\begin{code}
module Hexena.Codec.Parser.FileHeader (parseFileHeader) where

import Data.Binary.Get

import Hexena.Data.FileHeader (FileHeader(..))

parseFileHeader :: Get FileHeader
parseFileHeader = do
  fh_machine <- getWord16le
  fh_numOfSections <- getWord16le
  fh_timeDateStamp <- getWord32le
  fh_ptrToSymTbl <- getWord32le
  fh_numOfSymbols <- getWord32le
  fh_szOfOptHdr <- getWord16le
  fh_char <- getWord16le

  return $ FileHeader fh_machine fh_numOfSections fh_timeDateStamp fh_ptrToSymTbl fh_numOfSymbols fh_szOfOptHdr fh_char

\end{code}
